<html>
<head>
  <meta charset="UTF-8">
  <title>usermodel</title>
</head>
<body>


<?php
require 'Common/ConnDB.php';
require 'Common/config.php';
class IndexModel{
  private $conn;
     function __construct(){
      //连接数据库
      $this->conn=new ConnDB(DB_TYPE,DB_HOST,DB_USER,DB_PWD,DB_DBNAME,DB_CHARSET);

     }


  function loginn()
  {
      session_start();
      $uname=$_POST["uname"];
      $password=$_POST["password"];
      $pole=$_POST["pole"];
      if($pole==1){
        $sql = "select * from users where uname='$uname'and password='$password'";
        $result=$this->conn->query($sql);
      
         return $result;}
        else
        {
 $sql = "select * from admins where adminname='$uname'and password='$password'";
        $result=$this->conn->query($sql);
       
           return $result;
      }

     }   

  function getList()
  {
    $sql="select * from video";
    $data=$this->conn->query($sql);
    return $data;


  }

  function tvList()
  {
    $sql="select * from video";
    $data=$this->conn->query($sql);
    return $data;



}

     function musicList()
      {
    $sql="select * from video";
    $data=$this->conn->query($sql);
    return $data;



}

  function showList($vid)
  {
    $sql="select * from video  where vid=$vid";
    $data=$this->conn->query($sql);
    return $data;

  }






   function getIndexList()
   {
      $sql="select * from video";
 
 $data=$this->conn->query($sql);

    return $data;
  
 echo $data;   }


  function getIndexVideo()
   {
      $sql="select * from video where vid='17' ";
     
 $data=$this->conn->query($sql);

    return $data;
  
 echo $data;   }


 
  }
  ?>
</head>
</body>